import React from 'react'
import { switchCamera } from '@/utils/webRtc'

import './index.scss'
const RoomMainView = () => {

  /**
   * 点击全屏
   */
  const onclickFullScreen = () => {
    const videoDom = document.querySelector(`#main-view video`)

    if (videoDom) {
      videoDom.requestFullscreen()
    }
  }

  return (
    <div className="room-main-view">
      {/* 全屏展示 */}
      <i
        className="full-screen-icon iconfont icon-quanping_o"
        onClick={onclickFullScreen} />
      {/* 切换摄像头 */}
      <i
        className="switch-camera iconfont icon-quanping_o"
        onClick={switchCamera} />
      <div id="main-view" />
    </div>
  )
}

export default RoomMainView
